{template header}
<script type="text/javascript" src="{SITE_URL}public/js/city/jquery.cityselect.js"></script>
<script type="text/javascript">
    var city1 = "{$strGroup['province']}";
    if(city1==''){city1 = '北京';}
    var city2 = "{$strGroup['city']}";
    if(city2==''){city2 = '朝阳区';}

    $(function(){
        $("#city_3").citySelect({
            prov:city1,
            city:city2
        });

    });
</script>
<div class="container">
<div class="row">
<div class="col-md-8">
    <div class="panel panel-default">
        <div class="panel-body">

{if !$type&&!$all}
<ul class="nav nav-pills" style="padding-bottom: 10px">
    <li role="presentation" {if $all==1}class="active"{/if}><a href="{tsUrl('group','index',array('all'=>1))}">各馆</a></li>
    <li role="presentation" {if $all==3}class="active"{/if}><a href="{tsUrl('group','index',array('all'=>3))}">总馆</a></li>
    <li role="presentation" {if $all==2}class="active"{/if}><a href="{tsUrl('group','index',array('all'=>2))}">我的</a></li>
  <li role="presentation" {if $all==0}class="active"{/if}><a href="{tsUrl('group')}">全部</a></li>
</ul>
{else}

<section label="Copyright Reserved by PLAYHUDONG." style="margin: 5px 0px 0px;
    padding: 16px;
    margin:1em 0;
    border-style: none;
    line-height: 25px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow:0px 2px 8px rgb(153, 153, 153)" id="shifu_c_034" donone="shifuMouseDownCard(&#39;shifu_c_034&#39;)">
 <div>
     {if $type}
         {if $type==1}
            为分馆做月捐，提供运营经费，成为分馆馆东，作为分馆主人把握分馆发展方向，获得推举理事会治理分馆的权利！馆东不必去现场，无地域限制。目录按馆东紧缺程度排序，越靠前越缺人。为总馆做月捐，贴补总馆开支，成为总馆馆东，跟进项目进展，贡献智慧和经验。
         {/if}
         {if $type==2}
             如果周一到周五有时间，请报名分馆馆员，每月贡献半个工作日，到分馆值班，服务小读者！
         {/if}
         {if $type==3}
            报名总馆馆员，在线上或者线下贡献业余时间和技能，间接服务小读者！
         {/if}
     {else}
     如果您想参与图书馆建设，可以点击“报名”按钮。没有“报名“按钮的分馆，或者已经停办，或者暂不接受报名。如果你工作日时间可自由支配，建议报名馆员，每月贡献半个工作日，到分馆值班，服务小读者！如果你没有时间做馆员，建议报名馆东，为图书馆做月捐，提供运营经费，作为分馆主人把握分馆发展方向，获得推举理事会治理分馆的权利！

     {/if}
 </div>
</section>

{/if}

            <div class="row" style="margin-top: 20px;">

               {if $all==1}
                <div  class="col-sm-12" style="padding-bottom: 30px">
                    <ul style="padding:10px;display: flex">
                        <li style="padding-right: 2px">地区查询：</li>
                        <li style="padding-right: 2px">
                            <select onChange="MM_jumpMenu('parent',this,0)" style="width: 80px;font-size:10px;font-weight: 300;height: 20px">
                                <option value="{tsUrl('group','index',array('type'=>$type,'all'=>$all,'page'=>$page))}">所有省份</option>
                                {loop $strPro $key $item}
                                <option value="{tsUrl('group','index',array('type'=>$type,'all'=>$all,'page'=>$page,'province'=>$item))}" {if $province==$item}selected{/if}>{$item}</option>
                                {/loop}
                            </select>
                     </li>
                    <li style="padding-right: 2px">
                        <select onChange="MM_jumpMenu('parent',this,0)" style="width: 80px;font-size:10px;font-weight: 300;height: 20px">
                            <option value="{tsUrl('group','index',array('type'=>$type,'all'=>$all,'province'=>$province,'page'=>$page))}">所有城市</option>
                            {loop $strCity $key $item}
                            <option value="{tsUrl('group','index',array('type'=>$type,'all'=>$all,'province'=>$province,'page'=>$page,'city'=>$item))}" {if $city==$item}selected{/if}>{$item}</option>
                            {/loop}
                        </select>

                    </li>
                        <li style="padding-left: 5px"><a href="{tsUrl('group','sum')}">统计</a></li>
                        {if !isMobile()&&$GLOBALS['TS_USER']['isadmin']=='1'}
                        <li style="padding-left: 5px"><a href="{tsUrl('group','stock')}">打捞馆东</a></li>
                        {/if}
                </div>
                {/if}

                {loop $arrGroup $key $item}
                <div class="col-md-6">

                    <div class="sub-item" {if $all==1||$all==3}style="height:110px"{/if}>
                        <div class="pic">
                            <a href="{tsUrl('group','show',array('id'=>$item[groupid]))}">
                                <img src="{if $item[photo]}{php echo tsXimg($item['photo'],'group','120','200',$item['path'],1)}{else}{SITE_URL}public/images/group.jpg{/if}" alt="{$item[groupname]}" />
                            </a>

                        </div>
                        <div class="info">
                            <a href="{tsUrl('group','show',array('id'=>$item[groupid]))}">{$item[groupname]}</a>{if $GLOBALS['TS_USER']['isadmin']==1 }<span style="color: #7F93BC">（ID:{$item[groupid]}）</span>{/if}



                            {if ($all==1||$all==3)&&($item['joinway']==0||$item['isdonate']==1)}
                            <span class="content" style="float: right">
<!--
                                {if $item[isplace]>0}
                                {if $item[joinway]==0}
                                <a class="btn btn-success btn-xs" href="{tsUrl('group','join',array('groupid'=>$item['groupid'],'jointype'=>1))}">报名{if $item[isplace]==2}馆员{else}组员{/if}</a>
                                {else}
                                <a class="btn btn-default btn-xs" >不招{if $item[isplace]==2}馆{else}组{/if}员</a>
                                {/if}
                                {/if}


                                {if $item[isplace]==2}
                                {if $item[isdonate]==1}
                                <a class="btn btn-success  btn-xs" href="{tsUrl('group','join',array('groupid'=>$item['groupid'],'jointype'=>2))}">报名馆东</a>
                                {else}
                                <a class="btn btn-default btn-xs" >不招{if $item[isplace]==2}馆东{/if}</a>
                                {/if}
                                {/if}-->
                                {if $item[isplace]==2}
                                    {if !$type}
                                        <ul class="nav">
                                            <li class="dropdown">
                                                <a  data-toggle="dropdown" href="#" class="btn btn-info btn-xs">报名</a>
                                                <ul class="dropdown-menu">
                                                    {if $item[joinway]==0}
                                                    <li style="width: 40px">                                                <a  class="btn btn-info btn-xs" style="width:60px;height: 40px;padding:10px" onclick="{if(confirm('确定要报名做{$item[groupname]}馆员吗？{if $item[isplace]==2}{$item[groupname]}馆员{if $item[openday]}周{$item[openday]}{else}工作日（周一到周五）{/if}排班，请确定你可以服务。{/if}')){
 window.location='{tsUrl('group','join',array('groupid'=>$item['groupid'],'jointype'=>1))}';
 return true;
}return false;}"
                                                            >馆员</a></li>
                                                    {/if}
                                                    {if $item[isdonate]==1}
                                                    {if $item[groupid]==1}
                                                    <li> <a href="{tsUrl('group','join',array('jointype'=>2,'groupid'=>1))}" >馆东</a></li>
                                                    {else}
                                                    <li> <a data-toggle="modal" data-target="#do_open_form" onclick="Values($item['groupid'])" >馆东</a></li>
                                                    {/if}
                                                    {/if}
                                                </ul>
                                            </li>
                                        </ul>
                                    {else}
                                        {if $type==2}
                                             {if $GLOBALS['TS_USER']['phone'] }

                                                <a  class="btn btn-info btn-xs" style="width:60px;height: 40px;padding:10px" onclick="{if(confirm('确定要报名做{$item[groupname]}馆员吗？你以前曾经填写过报名信息，有可能报名过馆员或馆东，请确定你有时间精力承担更多的服务。{if $item[isplace]==2}{$item[groupname]}馆员{if $item[openday]}周{$item[openday]}{else}工作日（周一到周五）{/if}排班，请确定你可以服务。{/if}')){
 window.location='{tsUrl('group','join',array('groupid'=>$item['groupid'],'jointype'=>1))}';
 return true;
}return false;}"
                                                        >报名</a>

                                            {else}
                                                                                               <a  class="btn btn-info btn-xs" style="width:60px;height: 40px;padding:10px" onclick="{if(confirm('确定要报名做{$item[groupname]}馆员吗？{if $item[isplace]==2}{$item[groupname]}馆员{if $item[openday]}周{$item[openday]}{else}工作日（周一到周五）{/if}排班，请确定你可以服务。{/if}')){
 window.location='{tsUrl('group','join',array('groupid'=>$item['groupid'],'jointype'=>1))}';
 return true;
}return false;}"
                                                                                                       >报名</a>

                                             {/if}
                                        {else}
                                                   {if $item[groupid]==1}
                                                     <a class="btn btn-info btn-xs" style="width:60px;height: 40px;padding:10px" href="{tsUrl('group','join',array('jointype'=>2,'groupid'=>1))}" >报名</a>
                                                    {else}

                                              <a class="btn btn-info btn-xs" style="width:60px;height: 40px;padding:10px"  data-toggle="modal" data-target="#do_open_form" onclick="Values($item['groupid'])" >报名</a>
                                                                       {/if}

                                        {/if}
                                    {/if}
                               {else}
                                 <a  class="btn btn-info btn-xs" style="width:60px;height: 40px;padding:10px" href="{tsUrl('group','join',array('groupid'=>$item['groupid'],'jointype'=>1))}">报名</a>
                                {/if}
                            </span>
                            {/if}
                            <p class="content">{$item[groupdesc]}</p>
                            {if $all==1||$all==3}
                            <p class="content">
                                {if $all==1}
                                <!--
                                <span>{if $item['isassist'] }协办{else}主办{/if}</span>-->

                                <span>{if $item['openday'] }周{$item['openday']}排班{else}暂不排班{/if}</span>
                               {if $item['status']== 0 } <span><font color='orange'>已停办</font></span>{/if}
                                <span>{if $item['joinway']==1 }<font color='orange'>不招人</font>{/if}</span>
                                {if $GLOBALS['TS_USER']['isadmin'] }
                                <span>余额{php echo round($item[income]-$item[outcome],2)}</span>
                                {/if}
                                {/if}
                            </p>
                            <p class="content">
                                {if $all==1||$all==3}活跃{if $item[isplace]==2}馆{else}组{/if}员：$item[count_active]{if $item[joinway]==0}{if $item['sick']}<font color="red"> (缺!)</font>{/if}{/if}{/if}
                                {if $all==1}&nbsp;&nbsp;馆东：$item['count_sto']{if $item[isdonate]==1}{if $item['count_sto']<25}<font color="red"> (缺!)</font>{/if}{/if}{/if}
                            </p>
                            {/if}
                        </div>
                    </div>

                </div>
                {/loop}
            </div>
            <div class="page">{$pageUrl}</div>
</div>
</div>
</div>

<div class="col-md-4">

{if  $TS_USER[isadmin]==1}
<a class="btn btn-info btn-block btn-lg" href="{tsUrl('group','create',array('all'=>$all))}">
<span class="glyphicon glyphicon-plus-sign"></span> 创建小组</a>
<p></p>
{/if}

<!--
    <div class="panel panel-default">
        <div class="panel-heading">热门话题</div>
        <div class="panel-body">

            <div class="group_index_right_hottopic">

                <ul>
                    {loop $arrTopic $key $item}
                    <li>
                        <h3><a href="{tsUrl('group','topic',array('id'=>$item['topicid']))}{$mylink}" target="_blank">{$item['title']}</a></h3>


                        <div class="info">
                            <div class="left">来自：<a title="{$item['group']['groupname']}" target="_blank" href="{tsUrl('group','show',array('id'=>$item['groupid']))}">{$item['group']['groupname']}</a>小组</div>
                            <div class="right">{$item['count_comment']}评论</div>
                        </div>

                    </li>
                    {/loop}
                </ul>
            </div>


</div>
</div>



    <div class="panel panel-default">
        <div class="panel-heading">最新创建小组</div>
        <div class="panel-body">
            <div class="commlist">
                <ul>
                    {loop $arrNewGroup $key $item}
                   <li>
                       <a href="{tsUrl('group','show',array('id'=>$item[groupid]))}">{$item[groupname]}</a> ({$item[count_user]}成员)
                   </li>
                    {/loop}
                </ul>
            </div>

        </div>
    </div>
-->
<!--广告位-->
{php doAction('gobad','300')}
</div>
</div>
</div>
<style>
    *{
        margin: 0;
        padding: 0;
    }
    .notice{
        height: 40px;
        line-height: 40px;
        background-color: #f5f5f5;
    }
    .notice .input{
        zoom: 120%;
        vertical-align: middle;
    }
</style>
<div id="do_open_form" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true" >
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-body" >
                <form  id="open-form" class="form-horizontal" method="post" action="{tsUrl('group','join',array('jointype'=>2))}">
                    <input type="hidden" name="groupid" id="groupid" value="">

                    <div class="form-group">
                        <label class="col-sm-12 control-label" style="text-align: left;font-size: large"><span class="notice"><i class="fa fa-bookmark-o" ></i> 愿意担任理事 <input name="lishi" type="checkbox" value="1" /></span></label>

                        <label class="col-sm-12 control-label" style="text-align: left;font-weight: normal;line-height: 20px"><p>打勾则成为理事候选人，每年馆东大会有机会竞选分馆理事，加入分馆理事会，或者被理事会直接补选。</p><p>理事会由5-7名理事组成，向馆东大会负责，作为管理层和决策层承担规划、组织、协调工作，有机会为图书馆的存续和发展做出更大的贡献！</p><p>这意味着更多的责任和挑战，但也代表着更大的机会和荣耀。你确定要勾选吗？</p></label>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-12 control-label" style="text-align: left;font-size: large"><span class="notice"><i class="fa fa-bookmark-o" ></i> 愿意兼任馆员 <input name="isvo" type="checkbox" value="1" /></span></label>

                        <label class="col-sm-12 control-label" style="text-align: left;font-weight: normal;line-height: 20px"><p>打勾则成为候选馆员，除了做馆东，还要在工作日（周一至周五），每月要抽出两个半天，去图书馆值班。</p><p>馆员工作内容为接待小读者，登记借书还书，图书上架，办借阅卡，维持秩序，维护环境等等，工作内容充实，也比较辛苦。</p><p>你可想好了呀，这个活儿比做馆东门槛更高，你确定要勾选吗？</p></label>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-12 control-label" style="text-align: left;font-size: large"><i class="fa fa-bookmark-o" ></i> 以上可以均不选，直接点击提交。</label>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-offset-2 col-sm-10">
                            <button type="submit" class="btn btn-success">点击提交</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<script>
    $('do_open_form').modal('hide');
    function Values(groupid){
        $('#groupid').val(groupid);
    }
</script>




{template footer}